<!--
Version 0.1
SEMF - Web Desiging Framework for Sport Event Managment
Copyright (C) 2006, SEMF Developers

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
  <xsl:apply-templates /> 
</xsl:template>

<xsl:template match="component">
	<div style="position:absolute">
		<xsl:attribute name="id">
			<xsl:value-of select="@id"/>
		</xsl:attribute>
		
		
		<xsl:for-each select="container">
			<div>
				<xsl:attribute name="set_color">
					<xsl:text>1</xsl:text>
				</xsl:attribute>
				<xsl:attribute name="databind">
					<xsl:text>inner_</xsl:text><xsl:value-of select="//@id"/>
				</xsl:attribute>
				<xsl:attribute name="style">
					<xsl:if test="contains(//property/property[@key='Border-Color'],'#')">
						<xsl:text>border-width:1px; border-style:solid; border-color:</xsl:text>
						<xsl:value-of select="//property/property[@key='Border-Color']"></xsl:value-of>
						<xsl:text>;</xsl:text>
						<xsl:text>left:</xsl:text><xsl:value-of select="@x"/><xsl:text>px;</xsl:text>
						<xsl:text>top:</xsl:text><xsl:value-of select="@y"/><xsl:text>px;</xsl:text>
						<xsl:text>width:</xsl:text><xsl:value-of select="number(@width)"/><xsl:text>px;</xsl:text>
						<xsl:text>height:</xsl:text><xsl:value-of select="number(@height)"/><xsl:text>px;</xsl:text>
					</xsl:if>
					<xsl:if test="not(contains(//property/property[@key='Border-Color'],'#'))">
						<xsl:text>border-width:0px; border-style:dotted; border-color:#FFFFFF;</xsl:text>
						<xsl:text>left:</xsl:text><xsl:value-of select="@x"/><xsl:text>px;</xsl:text>
						<xsl:text>top:</xsl:text><xsl:value-of select="@y"/><xsl:text>px;</xsl:text>
						<xsl:text>width:</xsl:text><xsl:value-of select="@width"/><xsl:text>px;</xsl:text>
						<xsl:text>height:</xsl:text><xsl:value-of select="@height"/><xsl:text>px;</xsl:text>
					</xsl:if>
					<xsl:text>position:absolute; </xsl:text>
					<xsl:text>id:</xsl:text><xsl:value-of select="@id"/><xsl:text>;</xsl:text>
					<xsl:if test="//property/property[@key='No_Overflow']=2">
							<xsl:text>overflow:scroll;</xsl:text>
					</xsl:if>
					<xsl:if test="//property/property[@key='No_Overflow']=1">
						<xsl:text>overflow:hidden;</xsl:text>
					</xsl:if>
					<xsl:if test="//property/property[@key='No_Overflow']!=1">
						<xsl:if test="//property/property[@key='No_Overflow']!=2">
							<xsl:text>overflow:visible;</xsl:text>
						</xsl:if>
					</xsl:if>
					
					<xsl:if test="contains(//property/property[@key='Background-Color'],'#')">
						<xsl:text>background-color:</xsl:text>
						<xsl:value-of select="//property/property[@key='Background-Color']"/>
						<xsl:text>;</xsl:text>
					</xsl:if>
				</xsl:attribute>
				<xsl:attribute name="id">
					<xsl:value-of select="@id"/>
				</xsl:attribute>
			</div>
		</xsl:for-each>
	</div>

</xsl:template>
</xsl:stylesheet>